/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kurvykurvy.page;

import com.kurvykurvy.core.ui.Slide;
import com.kurvykurvy.image.JavaImageUtils;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragSource;
import java.awt.image.BufferedImage;

/**
 *
 * @author HY
 */
public class PageSpreadSlide
        extends Slide
{
    PageSpreadLayout spread;

    public PageSpreadSlide( PageSpreadLayout pageSpread )
    {
        spread = pageSpread;
    }

    @Override
    protected void initSlide()
    {
    }

    @Override
    protected void renderOffscreen()
    {
        BufferedImage img = new BufferedImage( getItemWidth(), getItemHeight(), BufferedImage.TYPE_INT_RGB );
        Graphics2D g2 = img.createGraphics();

        g2.setColor( Color.BLUE );
        g2.fillRect( OUTER_MARGIN.left, OUTER_MARGIN.top, ITEM_WIDTH, ITEM_HEIGHT );
        g2.dispose();

        buffer = img;
        thumbnail = JavaImageUtils.createThumbnail( buffer, ITEM_WIDTH );
    }

    @Override
    public Transferable getTransferable()
    {
        return (PageSpread) spread;
    }

    @Override
    public String getShortDescription()
    {
        return "";
    }
}
